var local="http://47.104.10.151";

function sendMassage() {
    var i=1;
    switch(i){
        case 1:
            sendOneLine1();
        case 2:
            sendOneLine2();
        case 3:
            sendOneLine3();
        case 4:
            sendOneLine4();
        case 5:
            sendOneLine5();
        case 6:
            sendOneLine6();
    }
    alert("发布成功");

    var doc1 = document.getElementsByName("Bid1");
    setCookie('company_code1',' ',1);
    setCookie('votebidcode1',' ',1);
    setCookie('keyId1',' ',1);
    setCookie('product_name1',' ',1);
    setCookie('model_code1',' ',1);
    setCookie('size1',' ',1);
    setCookie('brand1',' ',1);
    setCookie('inventory1',' ',1);
    setCookie('tax_status1',' ',1);
    setCookie('product_area1',' ',1);
    setCookie('deadline1',' ',1);

    var doc2 = document.getElementsByName("Bid2");
    setCookie('company_code2',' ',1);
    setCookie('votebidcode2',' ',1);
    setCookie('keyId2',' ',1);
    setCookie('product_name2',' ',1);
    setCookie('model_code2',' ',1);
    setCookie('size2',' ',1);
    setCookie('brand2',' ',1);
    setCookie('inventory2',' ',1);
    setCookie('tax_status2',' ',1);
    setCookie('product_area2',' ',1);
    setCookie('deadline2',' ',1);

    var doc3 = document.getElementsByName("Bid3");
    setCookie('company_code3',' ',1);
    setCookie('votebidcode3',' ',1);
    setCookie('keyId3',' ',1);
    setCookie('product_name3',' ',1);
    setCookie('model_code3',' ',1);
    setCookie('size3',' ',1);
    setCookie('brand3',' ',1);
    setCookie('inventory3',' ',1);
    setCookie('tax_status3',' ',1);
    setCookie('product_area3',' ',1);
    setCookie('deadline3',' ',1);

    var doc4 = document.getElementsByName("Bid4");
    setCookie('company_code4',' ',1);
    setCookie('votebidcode4',' ',1);
    setCookie('keyId4',' ',1);
    setCookie('product_name4',' ',1);
    setCookie('model_code4',' ',1);
    setCookie('size4',' ',1);
    setCookie('brand4',' ',1);
    setCookie('inventory4',' ',1);
    setCookie('tax_status4',' ',1);
    setCookie('product_area4',' ',1);
    setCookie('deadline4',' ',1);

    var doc5 = document.getElementsByName("Bid5");
    setCookie('company_code5',' ',1);
    setCookie('votebidcode5',' ',1);
    setCookie('keyId5',' ',1);
    setCookie('product_name5',' ',1);
    setCookie('model_code5',' ',1);
    setCookie('size5',' ',1);
    setCookie('brand5',' ',1);
    setCookie('inventory5',' ',1);
    setCookie('tax_status5',' ',1);
    setCookie('product_area5',' ',1);
    setCookie('deadline5',' ',1);

    var doc6 = document.getElementsByName("Bid6");
    setCookie('company_code6',' ',1);
    setCookie('votebidcode6',' ',1);
    setCookie('keyId6',' ',1);
    setCookie('product_name6',' ',1);
    setCookie('model_code6',' ',1);
    setCookie('size6',' ',1);
    setCookie('brand6',' ',1);
    setCookie('inventory6',' ',1);
    setCookie('tax_status6',' ',1);
    setCookie('product_area6',' ',1);
    setCookie('deadline6',' ',1);

    function setCookie(c_name,value,expiredays)
    {
        var exdate=new Date()
        exdate.setDate(exdate.getDate()+expiredays)
        document.cookie=c_name+ "=" +escape(value)+
            ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+";path=/";
    }
    function getCookie(c_name)
    {
        if (document.cookie.length>0)
        {
            c_start=document.cookie.indexOf(c_name + "=")
            if (c_start!=-1)
            {
                c_start=c_start + c_name.length+1
                c_end=document.cookie.indexOf(";",c_start)
                if (c_end==-1) c_end=document.cookie.length
                return unescape(document.cookie.substring(c_start,c_end))
            }
        }
        return ""
    }
}
function getCookie(c_name)
{
    if (document.cookie.length>0)
    {
        c_start=document.cookie.indexOf(c_name + "=")
        if (c_start!=-1)
        {
            c_start=c_start + c_name.length+1
            c_end=document.cookie.indexOf(";",c_start)
            if (c_end==-1) c_end=document.cookie.length
            return unescape(document.cookie.substring(c_start,c_end))
        }
    }
    return ""
}


function getBidCookie(){



    var doc1 = document.getElementsByName("Bid1");
    doc1[0].value=getCookie('company_code1');
    doc1[1].value=getCookie('model_code1');
    doc1[2].value=getCookie('size1');
    doc1[3].value=getCookie('brand1');
    doc1[4].value=getCookie('sale_price1');
    doc1[5].value=getCookie('inventory1');
    doc1[6].value=getCookie('area_name1');
    doc1[7].value=getCookie('sever_tax1');
    var doc2 = document.getElementsByName("Bid2");
    doc2[0].value=getCookie('product_name2');
    doc2[1].value=getCookie('model_code2');
    doc2[2].value=getCookie('size2');
    doc2[3].value=getCookie('brand2');
    doc2[4].value=getCookie('sale_price2');
    doc2[5].value=getCookie('inventory2');
    doc2[6].value=getCookie('area_name2');
    doc2[7].value=getCookie('sever_tax2');
    var doc3 = document.getElementsByName("Bid3");
    doc3[0].value=getCookie('product_name3');
    doc3[1].value=getCookie('model_code3');
    doc3[2].value=getCookie('size3');
    doc3[3].value=getCookie('brand3');
    doc3[4].value=getCookie('sale_price3');
    doc3[5].value=getCookie('inventory3');
    doc3[6].value=getCookie('area_name3');
    doc3[7].value=getCookie('sever_tax3');
    var doc4 = document.getElementsByName("Bid4");
    doc4[0].value=getCookie('product_name4');
    doc4[1].value=getCookie('model_code4');
    doc4[2].value=getCookie('size4');
    doc4[3].value=getCookie('brand4');
    doc4[4].value=getCookie('sale_price4');
    doc4[5].value=getCookie('inventory4');
    doc4[6].value=getCookie('area_name4');
    doc4[7].value=getCookie('sever_tax4');
    var doc5 = document.getElementsByName("Bid5");
    doc5[0].value=getCookie('product_name5');
    doc5[1].value=getCookie('model_code5');
    doc5[2].value=getCookie('size5');
    doc5[3].value=getCookie('brand5');
    doc5[4].value=getCookie('sale_price5');
    doc5[5].value=getCookie('inventory5');
    doc5[6].value=getCookie('area_name5');
    doc5[7].value=getCookie('sever_tax5');
    var doc6 = document.getElementsByName("Bid6");
    doc6[0].value=getCookie('product_name6');
    doc6[1].value=getCookie('model_code6');
    doc6[2].value=getCookie('size6');
    doc6[3].value=getCookie('brand6');
    doc6[4].value=getCookie('sale_price6');
    doc6[5].value=getCookie('inventory6');
    doc6[6].value=getCookie('area_name6');
    doc6[7].value=getCookie('sever_tax6');
}


function setCookieBid(){
    function setCookie(c_name,value,expiredays)
    {
        var exdate=new Date()
        exdate.setDate(exdate.getDate()+expiredays)
        document.cookie=c_name+ "=" +escape(value)+
            ((expiredays==null) ? "" : ";expires="+exdate.toGMTString())+";path=/";
    }
    function getCookie(c_name)
    {
        if (document.cookie.length>0)
        {
            c_start=document.cookie.indexOf(c_name + "=")
            if (c_start!=-1)
            {
                c_start=c_start + c_name.length+1
                c_end=document.cookie.indexOf(";",c_start)
                if (c_end==-1) c_end=document.cookie.length
                return unescape(document.cookie.substring(c_start,c_end))
            }
        }
        return ""
    }

    function clearCookie(name) {
        setCookie(name, "", -1);
    }




    var doc1 = document.getElementsByName("Bid1");
    var tax1=onchange1();
    var deadline1=document.getElementById("dtp_input1").value;
    setCookie('company_code1',doc1[0].value,1);
    setCookie('votebidcode1',doc1[1].value,1);
    setCookie('keyId1',doc1[2].value,1);
    setCookie('product_name1',doc1[3].value,1);
    setCookie('model_code1',doc1[4].value,1);
    setCookie('size1',doc1[5].value,1);
    setCookie('brand1',doc1[6].value,1);
    setCookie('inventory1',doc1[7].value,1);
    setCookie('tax_status1',tax1,1);
    setCookie('product_area1',doc1[8].value,1);
    setCookie('deadline1',deadline1,1);

    var doc2 = document.getElementsByName("Bid2");
    var tax2=onchange2();
    var deadline2=document.getElementById("dtp_input2").value;
    setCookie('company_code2',doc2[0].value,1);
    setCookie('votebidcode2',doc2[1].value,1);
    setCookie('keyId2',doc2[2].value,1);
    setCookie('product_name2',doc2[3].value,1);
    setCookie('model_code2',doc2[4].value,1);
    setCookie('size2',doc2[5].value,1);
    setCookie('brand2',doc2[6].value,1);
    setCookie('inventory2',doc2[7].value,1);
    setCookie('tax_status2',tax2,1);
    setCookie('product_area2',doc2[8].value,1);
    setCookie('deadline2',deadline2,1);

    var doc3 = document.getElementsByName("Bid3");
    var tax3=onchange3();
    var deadline3=document.getElementById("dtp_input3").value;
    setCookie('company_code3',doc3[0].value,1);
    setCookie('votebidcode3',doc3[1].value,1);
    setCookie('keyId3',doc3[2].value,1);
    setCookie('product_name3',doc3[3].value,1);
    setCookie('model_code3',doc3[4].value,1);
    setCookie('size3',doc3[5].value,1);
    setCookie('brand3',doc3[6].value,1);
    setCookie('inventory3',doc3[7].value,1);
    setCookie('tax_status3',tax3,1);
    setCookie('product_area3',doc3[8].value,1);
    setCookie('deadline3',deadline3,1);

    var doc4 = document.getElementsByName("Bid4");
    var tax4=onchange4();
    var deadline4=document.getElementById("dtp_input4").value;
    setCookie('company_code4',doc4[0].value,1);
    setCookie('votebidcode4',doc4[1].value,1);
    setCookie('keyId4',doc4[2].value,1);
    setCookie('product_name4',doc4[3].value,1);
    setCookie('model_code4',doc4[4].value,1);
    setCookie('size4',doc4[5].value,1);
    setCookie('brand4',doc4[6].value,1);
    setCookie('inventory4',doc4[7].value,1);
    setCookie('tax_status4',tax4,1);
    setCookie('product_area4',doc4[8].value,1);
    setCookie('deadline4',deadline4,1);

    var doc5 = document.getElementsByName("Bid5");
    var tax5=onchange5();
    var deadline5=document.getElementById("dtp_input5").value;
    setCookie('company_code5',doc5[0].value,1);
    setCookie('votebidcode5',doc5[1].value,1);
    setCookie('keyId5',doc5[2].value,1);
    setCookie('product_name5',doc5[3].value,1);
    setCookie('model_code5',doc5[4].value,1);
    setCookie('size5',doc5[5].value,1);
    setCookie('brand5',doc5[6].value,1);
    setCookie('inventory5',doc5[7].value,1);
    setCookie('tax_status5',tax5,1);
    setCookie('product_area5',doc5[8].value,1);
    setCookie('deadline5',deadline5,1);

    var doc6 = document.getElementsByName("Bid6");
    var tax6=onchange6();
    var deadline6=document.getElementById("dtp_input6").value;
    setCookie('company_code6',doc6[0].value,1);
    setCookie('votebidcode6',doc6[1].value,1);
    setCookie('keyId6',doc6[2].value,1);
    setCookie('product_name6',doc6[3].value,1);
    setCookie('model_code6',doc6[4].value,1);
    setCookie('size6',doc6[5].value,1);
    setCookie('brand6',doc6[6].value,1);
    setCookie('inventory6',doc6[7].value,1);
    setCookie('tax_status6',tax6,1);
    setCookie('product_area6',doc6[8].value,1);
    setCookie('deadline6',deadline6,1);
}

function getCookieStock(){

    var doc1 = document.getElementsByName("Bid1");
    doc1[0].value=getCookie('company_code1');
    doc1[1].value=getCookie('votebidcode1');
    doc1[2].value=getCookie('keyId1');
    doc1[3].value=getCookie('product_name1');
    doc1[4].value=getCookie('model_code1');
    doc1[5].value=getCookie('size1');
    doc1[6].value=getCookie('brand1');
    doc1[7].value=getCookie('inventory1');
    doc1[8].value=getCookie('product_area1');
    document.getElementById("dtp_input1").value=getCookie('deadline1');

    var doc2 = document.getElementsByName("Bid2");
    doc2[0].value=getCookie('company_code2');
    doc2[1].value=getCookie('votebidcode2');
    doc2[2].value=getCookie('keyId2');
    doc2[3].value=getCookie('product_name2');
    doc2[4].value=getCookie('model_code2');
    doc2[5].value=getCookie('size2');
    doc2[6].value=getCookie('brand2');
    doc2[7].value=getCookie('inventory2');
    doc2[8].value=getCookie('product_area2');
    document.getElementById("dtp_input2").value=getCookie('deadline2');



    var doc3 = document.getElementsByName("Bid3");
    doc3[0].value=getCookie('company_code3');
    doc3[1].value=getCookie('votebidcode3');
    doc3[2].value=getCookie('keyId3');
    doc3[3].value=getCookie('product_name3');
    doc3[4].value=getCookie('model_code3');
    doc3[5].value=getCookie('size3');
    doc3[6].value=getCookie('brand3');
    doc3[7].value=getCookie('inventory3');
    doc3[8].value=getCookie('product_area3');
    document.getElementById("dtp_input3").value=getCookie('deadline3');


    var doc4 = document.getElementsByName("Bid4");
    doc4[0].value=getCookie('company_code4');
    doc4[1].value=getCookie('votebidcode4');
    doc4[2].value=getCookie('keyId4');
    doc4[3].value=getCookie('product_name4');
    doc4[4].value=getCookie('model_code4');
    doc4[5].value=getCookie('size4');
    doc4[6].value=getCookie('brand4');
    doc4[7].value=getCookie('inventory4');
    doc4[8].value=getCookie('product_area4');
    document.getElementById("dtp_input4").value=getCookie('deadline4');

    var doc5 = document.getElementsByName("Bid5");
    doc5[0].value=getCookie('company_code5');
    doc5[1].value=getCookie('votebidcode5');
    doc5[2].value=getCookie('keyId5');
    doc5[3].value=getCookie('product_name5');
    doc5[4].value=getCookie('model_code5');
    doc5[5].value=getCookie('size5');
    doc5[6].value=getCookie('brand5');
    doc5[7].value=getCookie('inventory5');
    doc5[8].value=getCookie('product_area5');
    document.getElementById("dtp_input5").value=getCookie('deadline5');

    var doc6 = document.getElementsByName("Bid6");
    doc6[0].value=getCookie('company_code6');
    doc6[1].value=getCookie('votebidcode6');
    doc6[2].value=getCookie('keyId6');
    doc6[3].value=getCookie('product_name6');
    doc6[4].value=getCookie('model_code6');
    doc6[5].value=getCookie('size6');
    doc6[6].value=getCookie('brand6');
    doc6[7].value=getCookie('inventory6');
    doc6[8].value=getCookie('product_area6');
    document.getElementById("dtp_input6").value=getCookie('deadline6');

}




function getInvite() {
  var kid=getCookie('userId');
  var url = local+":8080/login/displayCompany_Code";
  xmlHttp = creatxmlHTTPInvite();
  function creatxmlHTTPInvite() {
    if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
      xmlHttp=new XMLHttpRequest();
    }else {
      // IE6, IE5 浏览器执行代码
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }

    return xmlHttp;
  }
  var txt = "";//用于存储拼接字符串；
  //获取数据
  //拼接字符
  txt = "user_Id=" + kid;
  xmlHttp.open("POST", url, true);
  xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  xmlHttp.send(txt);

  xmlHttp.onreadystatechange=function()
  {
    if (xmlHttp.readyState==4 && xmlHttp.status==200)
    {
      var result=xmlHttp.responseText;
      var json=eval("("+result+")");
      document.getElementById("invite_code").value=json.msg;
    }
  }
}

function getCookie(c_name)
{
  if (document.cookie.length>0)
  {
    c_start=document.cookie.indexOf(c_name + "=")
    if (c_start!=-1)
    {
      c_start=c_start + c_name.length+1
      c_end=document.cookie.indexOf(";",c_start)
      if (c_end==-1) c_end=document.cookie.length
      return unescape(document.cookie.substring(c_start,c_end))
    }
  }
  return ""
}



function sendOneLine1() {
    var xmlHttp = createXMLHttp1();
    function createXMLHttp1() {
        //使用大部分浏览器
        if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
        }
        if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(!xmlHttp){
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    var tax=onchange1();
    //获取主页的用户
    var keyId=getCookie('userId');
    alert(keyId);
    var txt="";//拼接字符串；
    var doc1=document.getElementsByName("Bid1");
    var deadline1=document.getElementById("dtp_input1").value;
    if(doc1[3].value.length==0){
        alert("请填写第一行数据！");
    }else {

    txt="user_id="+keyId+"&company_code="+doc1[0].value+"&product_name="+doc1[1].value+"&model_code="+doc1[2].value+
    "&size="+doc1[3].value+"&brand="+doc1[4].value+"&inventory="+doc1[5].value+
        "&tax_status="+tax+"&product_area="+ doc1[6].value+"&deadline="+deadline1;

    var url = local+":8080/bid/addBid";//服务器URL
      alert(txt);
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    }

    //传输结束

}
function sendOneLine2() {
    var xmlHttp = createXMLHttp2();
    function createXMLHttp2() {
        //使用大部分浏览器
        var xmlHttp;
        if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
        }
        if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(!xmlHttp){
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    var tax=onchange2();
    var txt="";//拼接字符串；
    //获取主页的用户
    var keyId=getCookie('userId');
    var doc2=document.getElementsByName("Bid2");
    var deadline2=document.getElementById("dtp_input2").value;
    if(doc2[3].value.length==0){
        alert("请填写第二行数据！");
    }else {
    txt="user_id="+keyId+"&company_code="+doc2[0].value+"&product_name="+doc2[1].value+"&model_code="+doc2[2].value+
        "&size="+doc2[3].value+"&brand="+doc2[4].value+
        "&inventory="+doc2[5].value+"&tax_status="+tax+"&product_area="+ doc2[6].value+"&deadline="+deadline2;
    var url = local+":8080/bid/addBid";//服务器URL
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
    }

    //传输结束

}
function sendOneLine3() {
    var xmlHttp = createXMLHttp3();
    function createXMLHttp3() {
        //使用大部分浏览器
        var xmlHttp;
        if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
        }
        if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(!xmlHttp){
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    var tax=onchange3();
    var txt="";//拼接字符串；
    //获取主页的用户
    var keyId=getCookie('userId');
    var doc3=document.getElementsByName("Bid3");
    var deadline3=document.getElementById("dtp_input3").value;
    if(doc3[3].value.length==0){
        alert("请填写第三行数据！");
    }else {
        txt = "user_id=" + keyId + "&company_code=" + doc3[0].value + "&product_name=" + doc3[1].value + "&model_code=" + doc3[2].value +
            "&size=" + doc3[3].value + "&brand=" + doc3[4].value + "&inventory=" +
            doc3[5].value + "&tax_status=" + tax + "&product_area=" + doc3[6].value+"&deadline="+deadline3;
        var url = local+":8080/bid/addBid";//服务器URL
        xmlHttp.open("POST", url, true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.send(txt);
    }
    //传输结束

}
function sendOneLine4() {
    var xmlHttp = createXMLHttp4();
    function createXMLHttp4() {
        //使用大部分浏览器
        var xmlHttp;
        if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
        }
        if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(!xmlHttp){
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    var tax=onchange4();
    var txt="";//拼接字符串；
    //获取主页的用户
    var keyId=getCookie('userId');
    var doc4=document.getElementsByName("Bid4");
    var deadline4=document.getElementById("dtp_input4").value;
    if(doc4[3].value.length==0){
        alert("请填写第四行数据！");
    }else {
        txt = "user_id=" + keyId + "&company_code=" + doc4[0].value + "&product_name=" + doc4[1].value + "&model_code=" + doc4[2].value +
            "&size=" + doc4[3].value + "&brand=" + doc4[4].value + "&inventory=" +
            doc4[5].value + "&tax_status=" + tax + "&product_area=" + doc4[6].value+"&deadline="+deadline4;
        var url = local+":8080/bid/addBid";//服务器URL
        xmlHttp.open("POST", url, true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.send(txt);
    }
    //传输结束

}
function sendOneLine5() {
    var xmlHttp = createXMLHttp5();
    function createXMLHttp5() {
        //使用大部分浏览器
        var xmlHttp;
        if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
        }
        if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(!xmlHttp){
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    var tax=onchange5();
    var txt="";//拼接字符串；
    //获取主页的用户
    var keyId=getCookie('userId');
    var doc5=document.getElementsByName("Bid5");
    var deadline5=document.getElementById("dtp_input5").value;
    if(doc5[3].value.length==0){
        alert("请填写第五行数据！");
    }else {
        txt = "user_id=" + keyId + "&company_code=" + doc5[0].value + "&product_name=" + doc5[1].value + "&model_code=" + doc5[2].value +
            "&size=" + doc5[3].value + "&brand=" + doc5[4].value +
            "&inventory=" + doc5[5].value + "&tax_status=" + tax + "&product_area=" +
            doc5[6].value+"&deadline="+deadline5;
        var url = local+":8080/bid/addBid";//服务器URL
        xmlHttp.open("POST", url, true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.send(txt);
    }
    //传输结束

}
function sendOneLine6() {
    var xmlHttp = createXMLHttp6();
    function createXMLHttp6() {
        //使用大部分浏览器
        var xmlHttp;
        if(window.XMLHttpRequest){
            xmlHttp=new XMLHttpRequest();
        }
        if(window.ActiveXObject){
            xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            if(!xmlHttp){
                xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
            }
        }
        return xmlHttp;
    }
    var tax=onchange6();
    var txt="";//拼接字符串；
    //获取主页的用户
    var keyId=getCookie('userId');
    var doc6=document.getElementsByName("Bid6");
    var deadline6=document.getElementById("dtp_input6").value;
    if(doc6[3].value.length==0){
        alert("请填写第六行数据！");
    }else {
        txt = "user_id=" + keyId + "&company_code=" + doc6[0].value + "&product_name=" + doc6[1].value + "&model_code=" + doc6[2].value +
            "&size=" + doc6[3].value + "&brand=" + doc6[4].value + "&inventory=" + doc6[5].value +
            "&tax_status=" + tax + "&product_area=" + doc6[6].value+"&deadline="+deadline6;
        var url =local+ ":8080/bid/addBid";//服务器URL
        xmlHttp.open("POST", url, true);
        xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        xmlHttp.send(txt);
    }
    //传输结束

}


function onchange1() {
    var doc=document.getElementsByName("Bidradio1");
    for(i=0;i<doc.length;i++){
        if(doc[i].checked){
            return doc[i].value;
        }
    }
}
function onchange2() {
    var doc=document.getElementsByName("Bidradio2");
    for(i=0;i<doc.length;i++){
        if(doc[i].checked){
            return doc[i].value;
        }
    }
}
function onchange3() {
    var doc=document.getElementsByName("Bidradio3");
    for(i=0;i<doc.length;i++){
        if(doc[i].checked){
            return doc[i].value;
        }
    }
}
function onchange4() {
    var doc=document.getElementsByName("Bidradio4");
    for(i=0;i<doc.length;i++){
        if(doc[i].checked){
            return doc[i].value;
        }
    }
}
function onchange5() {
    var doc=document.getElementsByName("Bidradio5");
    for(i=0;i<doc.length;i++){
        if(doc[i].checked){
            return doc[i].value;
        }
    }
}
function onchange6() {
    var doc=document.getElementsByName("Bidradio6");
    for(i=0;i<doc.length;i++){
        if(doc[i].checked){
            return doc[i].value;
        }
    }
}

//适配浏览器
//根据不同浏览器发送不同请求
function createXMLHttp() {
    //使用大部分浏览器
    var xmlHttp;
    if(window.XMLHttpRequest){
        xmlHttp=new XMLHttpRequest();
    }
    if(window.ActiveXObject){
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
        if(!xmlHttp){
            xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
        }
    }
    return xmlHttp;
}

$( document ).ready(function() {
    getInvite();
    getCookieStock();


});